﻿using System;
using System.Linq;
using System.Collections.Generic; 
using System.Data;
using Matrix.Common.Utility;
using Matrix.MaKaYunShang.Model;
using Matrix.MaKaYunShang.DAL;

namespace Matrix.MaKaYunShang.BLL
{
	public partial class DiscountTimesProbabilityBLL : BaseBLL<DiscountTimesProbabilityBLL>
	{
		#region 默认方法
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int  Add(DiscountTimesProbability model)
		{
			return DiscountTimesProbabilityDAL.Instance.Add(model);		
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(DiscountTimesProbability model)
		{
			return DiscountTimesProbabilityDAL.Instance.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(int DiscountBaseId)
		{			
			return DiscountTimesProbabilityDAL.Instance.Delete(DiscountBaseId);
		}
				/// <summary>
		/// 批量删除一批数据
		/// </summary>
		public bool DeleteList(string DiscountBaseIdlist )
		{
			return DiscountTimesProbabilityDAL.Instance.DeleteList(DiscountBaseIdlist );
		}
		
		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public DiscountTimesProbability GetModel(int DiscountBaseId)
		{
			var ds = DiscountTimesProbabilityDAL.Instance.GetModel(DiscountBaseId);
            return ds == null ? null : ServicesHelper.DataSetToIList<DiscountTimesProbability>(ds).ToList()[0];
		}
		
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<DiscountTimesProbability> GetModelList(string strWhere = null)
		{
			var ds = DiscountTimesProbabilityDAL.Instance.GetList(strWhere);
			return ServicesHelper.DataSetToIList<DiscountTimesProbability>(ds).ToList();
		}
		#endregion
		
		#region 扩展方法

	    public bool DeleteByDiscountBaseId(int DiscountBaseId)
	    {
	        return DiscountTimesProbabilityDAL.Instance.DeleteByDiscountBaseId(DiscountBaseId);
	    }

	    #endregion
	}
}